﻿/*
 * Copyright (c) 2009, 北京理工大学  王柳茗
 * All rights reserved.
 *
 * $Revision$
 *
 * $Author$
 *
 * $Date$
 *
 * $Log$
 *
 */
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace wlm.wsx
{
    /// <summary>
    /// Token class 
    /// </summary>
    public sealed class Tokens
    {
        private Tokens()
        {
        }
        /// <summary>
        /// 
        /// </summary>
        /// <param name="token"></param>
        /// <returns></returns>
        public static String TokenToString(int token)
        {
            switch (token)
            {
                case IF: return "if";

                case PLUS: return "+";
                case MINUS: return "-";
                case MUL: return "*";
                case DIV: return "/";
                case ASSIGN: return ":=";
                case IDENT: return "IDENT";
                case NUMBER: return "NUMBER";
                case ERROR: return "ERROR";
                case EOF: return "EOF";
            }
            return "Unkown Token";
        }
        //key words
        public const int IF = 0;
        //operator
        public const int PLUS = 10;
        public const int MINUS = 11;
        public const int MUL = 12;
        public const int DIV = 13;
        public const int ASSIGN = 14;
        //an identifier
        public const int IDENT = 30;
        //a number
        public const int NUMBER = 31;

        public const int ERROR = 40;
        public const int EOF = 41;        
    }
}
